<div class="form">

    <?php
    $form = $this->beginWidget('CActiveForm', array(
        'id' => 'person-form',
        'enableAjaxValidation' => false,
        'htmlOptions' => array(
            'enctype' => 'multipart/form-data',
        ),
    ));
    ?>

    <p class="note">带星号<span class="required">*</span> 是必填的.</p>

    <?php echo $form->errorSummary($model); ?>

    <div class="row">
        <?php echo $form->labelEx($model, 'departmentId'); ?>
        <?php echo $form->dropDownList($model, 'departmentId', CHtml::listData(Department::model()->findAll(array('order' => 'name')), 'id', 'name')); ?>
        <?php echo $form->error($model, 'departmentId'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'titleID'); ?>
        <?php echo $form->dropDownList($model, 'titleID', CHtml::listData(Title::model()->findAll(array('order' => 'name')), 'id', 'name')); ?>
        <?php echo $form->error($model, 'titleID'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'name'); ?>
        <?php echo $form->textField($model, 'name', array('size' => 25, 'maxlength' => 25)); ?>
        <?php echo $form->error($model, 'name'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'english'); ?>
        <?php echo $form->textField($model, 'english', array('size' => 30, 'maxlength' => 30)); ?>
        <?php echo $form->error($model, 'english'); ?>
    </div>        


    <div class="row">
        <?php echo $form->labelEx($model, 'mobile'); ?>
        <?php echo $form->textField($model, 'mobile', array('size' => 13, 'maxlength' => 13)); ?>
        <?php echo $form->error($model, 'mobile'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'Ext'); ?>
        <?php echo $form->textField($model, 'Ext', array('size' => 6, 'maxlength' => 6)); ?>
        <?php echo $form->error($model, 'Ext'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'short'); ?>
        <?php echo $form->textField($model, 'short', array('size' => 15, 'maxlength' => 15)); ?>
        <?php echo $form->error($model, 'short'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'skype'); ?>
        <?php echo $form->textField($model, 'skype', array('size' => 25, 'maxlength' => 25)); ?>
        <?php echo $form->error($model, 'skype'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'mail'); ?>
        <?php echo $form->textField($model, 'mail', array('size' => 25, 'maxlength' => 25)); ?>
        <?php echo $form->error($model, 'mail'); ?>
    </div>
 
    
    <div class="row">
        <?php echo $form->labelEx($model, 'image'); ?>
        <?php echo CHtml::activeFileField($model, 'image'); ?> 
        <?php echo $form->error($model, 'image'); ?>
    </div>
    <?php // if ($model->isNewRecord != '1') { ?>
        <div class="row">
            <?php echo CHtml::image(Yii::app()->request->baseUrl . '/../images/' . $model->image, "", array("width" => 200)); ?>
        </div>

        <div class="row">
            <?php echo $form->labelEx($model, 'memo'); ?>
            <?php echo $form->textField($model, 'memo', array('size' => 35, 'maxlength' => 35)); ?>
            <?php echo $form->error($model, 'memo'); ?>
        </div>

        <div class="row buttons">
            <?php echo CHtml::submitButton($model->isNewRecord ? '新建' : '保存'); ?>
        </div>

        <?php $this->endWidget(); ?>

</div><!-- form -->